package com.crm.service.crm.transfer.controller;

import com.crm.model.common.dtos.ResponseResult;
import com.crm.model.crm.transfer.redeploy.dtos.RedeployDto;
import com.crm.model.crm.transfer.redeploy.dtos.RedeployHandleDto;
import com.crm.service.crm.transfer.service.RedeployService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/api/v1/redeploy")
public class RedeployController {
    @Autowired
    protected RedeployService redeployService;

    /**
     * 条件分页查询
     * @param dto
     * @return
     */
    @GetMapping("/list")
    public ResponseResult findPhoneOrNameOrTime(RedeployDto dto){
        log.info("条件分页查询:{}",dto);
        return redeployService.findPhoneOrNameOrTime(dto);
    }

    /**
     * 转派管理处理回显
     * @param id
     * @return
     */
    @GetMapping("/handle/{id}")
    public ResponseResult handleQueryRedeploy(@PathVariable Integer id){
        log.info("根据用户id查询:{}",id);
        return redeployService.updateRedeploy(id);
    }

    /**
     * 处理确定
     * @param dto
     * @return
     */
    @PostMapping("/update")
    public ResponseResult updateRedeploy(@RequestBody RedeployHandleDto dto){
        log.info("转派确定:{}",dto);

        return null;
    }
}
